package com.kjtpay.design_pattern.state;

class RestState extends State {
    // 下班时间；工作完成，晚上5~9点之间
    @Override
    public void writeProgram(Work work) {
        if ((work.hour >= 17) && (work.hour < 21) && work.finish) {
            information = "当前时间：" + work.hour + "点" + work.hour + "分"
                    + " ===> 下班回家了";
        } else {
            work.current = new SleepingState();
            work.writeProgram();
        }
    }
}
